//@author A0101056Y
#include "Event.h"

Event::Event (){ 
	reset();
}

void Event::reset() {
	_startTime.reset();
	_endTime.reset();
	_remindTime.reset();
	_tag.clear();
	_tag.shrink_to_fit();
	_details = "";
	_repeatRule.reset();
	_isDone = false;
	_isReminded = false;
	_isFavourite = false;
	_isMissed = false;
	_isDuration = false;
}

const Time& Event::getStartTime() const {
	return _startTime;
}

const Time& Event::getEndTime() const {
	return _endTime;
}

vector <string>* Event::getTagPtr() {
	return &_tag;
}

string Event::getDetails() const {
	return _details;
}

REPEAT_RULE Event::getRepeatRule() const {
	return _repeatRule;
}

const Time& Event::getRemindTime() const {
	return _remindTime;
}

bool Event::isDone() const {
	return _isDone;
}

bool Event::isMissed() const {
	return _isMissed;
}

bool Event::isReminded() const {
	return _isReminded;
}

bool Event::isFavourite() const {
	return _isFavourite;
}

bool Event::isDuration () const {
	return _isDuration;
}

void Event::setStartTime(const Time& startTime){
	_startTime = startTime;
}

void Event::setEndTime(const Time& endTime){
	_endTime = endTime;
}

void Event::setRemindTime(const Time& remindTime){
	_remindTime = remindTime;
}

void Event::setDetails(const string& details){
	_details = details;
}

void Event::setRepeatRule(const REPEAT_RULE& repeatRule){
	_repeatRule = repeatRule;
}

void Event::setDone(bool isDone) {
	_isDone = isDone;
}

void Event::setReminded(bool isReminded){
	_isReminded = isReminded;
}

void Event::setMissed (bool newBool) {
	_isMissed = newBool;
}

void Event::setFavourite (bool newValue ) {
	_isFavourite = newValue;
}

void Event::setDurationType (bool newType) {
	_isDuration = newType;
}

bool Event::operator == (const Event& rightOperand) const {
	if (_details == rightOperand._details &&
		_startTime == rightOperand._startTime &&
		_endTime == rightOperand._endTime &&
		_remindTime == rightOperand._remindTime &&
		isEqualVector (this->_tag,rightOperand._tag)  &&
		_repeatRule == rightOperand._repeatRule &&
		_isDone == rightOperand._isDone &&
		_isReminded == rightOperand._isReminded &&
		_isMissed == rightOperand._isMissed &&
		_isFavourite == rightOperand._isFavourite &&
		_isDuration == rightOperand._isDuration){
			return true;
	}
	else{
		return false;
	}
	
}
